﻿namespace EasyWeb.Web.UI.Html
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Web.Configuration;
    using System.Web.Mvc;

    public static class EWUrlHelperExtensions
    {
        public static string ContentUrl(this UrlHelper helper, string debugUrl, string releaseUrl)
        {
            EWGuard.IsNotNull(helper, "helper");

            var section = (CompilationSection)WebConfigurationManager.GetWebApplicationSection("system.web/compilation");
            var url = section.Debug ? debugUrl : releaseUrl;
            return helper.Content(url);
        }
    }
}
